<script setup>
import { ref,onMounted } from 'vue'
import axios from 'axios'
//查询所有
const search = async() => {
  const result = await axios.get('https://apifoxmock.com/m1/3128855-1224313-default/depts');
  if (result.data.code) {
    deptList.value = result.data.data;
  }
}
const handleClick = () => {
  console.log('click')
}
const deptList = ref([])
</script>

<template>
<div class="container">
  <h1>部门管理</h1>
  <el-button type="primary">+ 新增部门</el-button>
</div>
<div class="container"> 
  <el-table :data="tableData" style="width: 100%">
    <el-table-column fixed prop="index" label="序号" width="100" />
    <el-table-column fixed prop="date" label="时间" width="140" />
    <el-table-column prop="name" label="部门名称" width="260" />
    <el-table-column prop="lastDate" label="最后操作时间" width="240" />
    <el-table-column fixed="right" label="操作" min-width="120">
      <template #default>
        <el-button link type="primary" size="small" @click="handleClick">
          删除
        </el-button>
        <el-button link type="primary" size="small">修改</el-button>
      </template>
    </el-table-column>
  </el-table>
</div>
</template>

<style scoped>
.container{
  margin: 10px 0px;
}

</style>